package com.dacel.ergraph.util.logging;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;

/**
 * Servlet d'initialisation du logger.
 * 
 * @author dacel
 *
 */
public class ErgraphLog4JInitServlet extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8282021051707510820L;
	
	/**
	 * Le logger.
	 */
	private static Logger log;

	/**
	 * @see javax.servlet.GenericServlet#init(javax.servlet.ServletConfig)
	 */
	public void init(ServletConfig config) throws ServletException {
		super.init(config);
		ClassLoader cl = this.getClass().getClassLoader();
		DOMConfigurator.configure(cl.getResource("log4j.xml"));
		log = Logger.getLogger(ErgraphLog4JInitServlet.class);
		
		log.info("Configuration Log4j -> OK");
	}
}
